package com.singzi.leetcode.N500;
public class T0478 {

}
class Solution0478 {
    double x_center;
    double y_center;
    double radius;


    public Solution0478(double radius, double x_center, double y_center) {
        this.x_center = x_center;
        this.y_center = y_center;
        this.radius = radius;

    }

    public double[] randPoint() {

        double x = Math.random() * 2*radius + x_center - radius;
        double y = Math.random() * 2*radius + y_center - radius;
        while (Math.pow(x - radius, 2) + Math.pow(y-radius, 2) >= Math.pow(radius, 2)){
            x = Math.random() * 2*radius + x_center - radius;
            y = Math.random() * 2*radius + y_center - radius;
        }
        return new double[]{x,y};

    }
}